{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## PCA Analysis in Python's using sklearn\n",
    "\n",
    "This notebook serves to discuss what is actually occuring behind the scenes in sklearn when the decomposition.pca package is being used.\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "unitary eigenvectors:  complex square matrix U is unitary if its conjugate transpose U∗ is also its inverse—that is, if U'U = UU'=I"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "https://en.wikipedia.org/wiki/Unitary_matrix"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### Two excellent references:\n",
    "1. [Machine Learning: A Probabalistic Method](https://mitpress.mit.edu/books/machine-learning-0), *by Kevin P. Murphy* (he was a senior Research Scientist at Google in early days)\n",
    "2. [The Elements of Statistical Learning: Data Mining, Inference and Prediction](https://web.stanford.edu/~hastie/ElemStatLearn/), *by Hastie et. al.* (authors are from CS and Stats departments at Stanford)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "\n",
    "import numpy as np\n",
    "import random\n",
    "import matplotlib.pyplot as plt\n",
    "from sklearn.decomposition import PCA\n",
    "import decimal\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Generate Signals"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "metadata": {},
   "outputs": [],
   "source": [
    "base_signalA = np.array([1, 1, 0, 0, 0, 0, 0, 0, 0, 0])\n",
    "base_signalB = np.array([0, 0, 0, 0, 1, 1, 0, 0, 0, 0])\n",
    "base_signalC = np.array([0, 0, 0, 0, 0, 0, 0, 0, 1, 1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "metadata": {},
   "outputs": [],
   "source": [
    "#plt.plot(range(0, 10), (base_signalA + base_signalB + base_signalC) /3.0, 'b--');"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAIABJREFUeJzt3Xl81NW9//HXyZ6QQBYmQBJiWMKS\nGUUlIooLKrYoVu61lrp7a2/p9ZbaXm2tervaXxdtbavWve5YFbUqWtRat1ZvtQQQ/E7YQ4EgMGEN\nBMh6fn98GSELZCAzc77L5/l45GGS803yZpx88p3zPd/PUVprhBBCeEuK6QBCCCHiT4q7EEJ4kBR3\nIYTwICnuQgjhQVLchRDCg6S4CyGEB0lxF0IID5LiLoQQHiTFXQghPCjN1A8eOHCgrqioMPXjhRDC\nlRYsWLBFax3o7Thjxb2iooKamhpTP14IIVxJKbU2luNkWkYIITxIirsQQniQFHchhPAgKe5CCOFB\nUtyFEMKDei3uSqlHlFIRpZR1iHGllLpLKbVKKbVEKXVi/GMKIYQ4ErGcuT8GTD3M+HlA5f63mcB9\nfY8lhBCiL3pd5661/ptSquIwh0wHntD2fn0fKqXylVJDtNYb45Sxm9mzYcWKzp8bOBCuu85+/+GH\nYW2XlaAlJfBf/2W/f++9sGlT5/Fhw+ArX7Hf/93vYNu2zuNjxsBll9nv33477N4NJ58M06b1/d8j\n4seKWMwJz+n2+ZnjZ1LWv4yFGxfy0rKXuo3PmjCL4n7F/GP9P3ht1Wvdxq8/5Xrys/J571/v8daa\nt7qN33zazWSnZ/OX1X/h/XXvE8gJMGvCLJRS8fmHib578UVYtKj75y+6CI4/3i4aDz/cffySS6Cq\nyi46s2d3H7/6ahgxAiwL5nR/7jFzJpSVwcKF8NJLEArBjBl9//f0Rmvd6xtQAViHGHsVOO2gj98C\nqg9x7EygB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dJcRdCCA+S4i6EEB7U601MCfvBSjUAa4/yyweSoNYGLiWP\nR2fyeBwgj0VnXng8jtFaB3o7yFhx7wulVE0sd2j5hTwencnjcYA8Fp356fGQaRkhhPAgKe5CCOFB\nbi3uD5oO4DDyeHQmj8cB8lh05pvHw5Vz7kIIIQ7PrWfuQgghDsN1xb23zbr9Qik1VCn1jlJqqVIq\nrJT6lulMTqCUSlVKLVJKvWo6i2lKqXyl1PNKqWX7nyenmM5kilLqf/b/nlhKqaeVUlmmMyWaq4p7\njJt1+0UbcIPWeiwwEfiGjx+Lg30LWGo6hEPcCbyutR4DjMOnj4tSqhS4DqjWWoewW5d7vi25q4o7\nsW3W7Qta641a64X739+F/YubnP27HEopVQZMA/5gOotpSqn+wBnYey2gtW7RWu84/Fd5WhqQvX+n\nuBzgU8N5Es5txb2nzbp9XdAAlFIVwAnAR2aTGPc74Eagw3QQBxgONACP7p+m+oNSqp/pUCZorTcA\nvwbWARuBnVrrv5hNlXhuK+4xbcTtJ0qpXOAF4Nta60bTeUxRSl0ARLTWC0xncYg04ETgPq31CUAT\n4MtrVEqpAuxX+MOAEqCfUuoKs6kSz23FvR4YetDHZfjg5dWhKKXSsQv7U1rrP5nOY9gk4EKl1L+w\np+vOVkrNNhvJqHqgXmsdfTX3PHax96MpwBqtdYPWuhX4E3Cq4UwJ57biHstm3b6glFLY86lLtda/\nMZ3HNK31zVrrMq11Bfbz4m2ttefPzg5Fa70JWK+UGr3/U+cAtQYjmbQOmKiUytn/e3MOPri4HNMe\nqk5xqM26DccyZRJwJfCJUurj/Z+7Zf9+t0IAfBN4av+JUB3wFcN5jNBaf6SUeh5YiL3KbBE+uFNV\n7lAVQggPctu0jBBCiBhIcRdCCA+S4i6EEB4kxV0IITxIirsQQniQFHchhPAgKe5CCOFBUtyFEMKD\n/j8JhCNEQGqvaAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1a161d8850>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(range(0, 10), base_signalA, 'b--');\n",
    "plt.plot(range(0, 10), base_signalB, 'g--');\n",
    "plt.plot(range(0, 10), base_signalC, 'r--');"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Every signal is based on other signals\n",
    "\n",
    "allSignals = []\n",
    "counter = 0\n",
    "\n",
    "for number in range(0,1000):\n",
    "    firstSignal = np.array(np.nan * np.zeros(10))\n",
    "    for x in range(0,len(base_signalA)):\n",
    "        firstSignal[x] = (np.random.uniform(.99,1) * base_signalA[x]) + np.random.uniform(0,.01)\n",
    "    allSignals.append(firstSignal)\n",
    "        \n",
    "for number in range(0,1000):\n",
    "    secondSignal = np.array(np.nan * np.zeros(10))\n",
    "    for x in range(0,len(base_signalB)):\n",
    "        secondSignal[x] = (np.random.uniform(.99,1) * base_signalB[x]) + np.random.uniform(0,.01)\n",
    "    allSignals.append(secondSignal)\n",
    "    \n",
    "for number in range(0,1000):  \n",
    "    thirdSignal = np.array(np.nan * np.zeros(10))\n",
    "    for x in range(0,len(base_signalC)):\n",
    "        thirdSignal[x] = (np.random.uniform(.99,1) * base_signalC[x]) + np.random.uniform(0,.01)\n",
    "    allSignals.append(thirdSignal)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "metadata": {},
   "outputs": [],
   "source": [
    "allSignals = pd.DataFrame(allSignals)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "      <th>4</th>\n",
       "      <th>5</th>\n",
       "      <th>6</th>\n",
       "      <th>7</th>\n",
       "      <th>8</th>\n",
       "      <th>9</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.999633</td>\n",
       "      <td>0.996879</td>\n",
       "      <td>0.001890</td>\n",
       "      <td>0.003040</td>\n",
       "      <td>0.000594</td>\n",
       "      <td>0.000306</td>\n",
       "      <td>0.001648</td>\n",
       "      <td>0.004717</td>\n",
       "      <td>0.004202</td>\n",
       "      <td>0.005064</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1.005212</td>\n",
       "      <td>1.000013</td>\n",
       "      <td>0.006776</td>\n",
       "      <td>0.004553</td>\n",
       "      <td>0.005299</td>\n",
       "      <td>0.000441</td>\n",
       "      <td>0.006752</td>\n",
       "      <td>0.001622</td>\n",
       "      <td>0.006706</td>\n",
       "      <td>0.006507</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1.003700</td>\n",
       "      <td>1.005501</td>\n",
       "      <td>0.001348</td>\n",
       "      <td>0.000865</td>\n",
       "      <td>0.004672</td>\n",
       "      <td>0.008888</td>\n",
       "      <td>0.005150</td>\n",
       "      <td>0.008301</td>\n",
       "      <td>0.002988</td>\n",
       "      <td>0.006352</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.995212</td>\n",
       "      <td>1.002144</td>\n",
       "      <td>0.001229</td>\n",
       "      <td>0.002564</td>\n",
       "      <td>0.004303</td>\n",
       "      <td>0.000191</td>\n",
       "      <td>0.001723</td>\n",
       "      <td>0.005112</td>\n",
       "      <td>0.004153</td>\n",
       "      <td>0.003944</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1.001160</td>\n",
       "      <td>1.003664</td>\n",
       "      <td>0.003120</td>\n",
       "      <td>0.000875</td>\n",
       "      <td>0.007157</td>\n",
       "      <td>0.007329</td>\n",
       "      <td>0.008568</td>\n",
       "      <td>0.007089</td>\n",
       "      <td>0.008629</td>\n",
       "      <td>0.008507</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          0         1         2         3         4         5         6  \\\n",
       "0  0.999633  0.996879  0.001890  0.003040  0.000594  0.000306  0.001648   \n",
       "1  1.005212  1.000013  0.006776  0.004553  0.005299  0.000441  0.006752   \n",
       "2  1.003700  1.005501  0.001348  0.000865  0.004672  0.008888  0.005150   \n",
       "3  0.995212  1.002144  0.001229  0.002564  0.004303  0.000191  0.001723   \n",
       "4  1.001160  1.003664  0.003120  0.000875  0.007157  0.007329  0.008568   \n",
       "\n",
       "          7         8         9  \n",
       "0  0.004717  0.004202  0.005064  \n",
       "1  0.001622  0.006706  0.006507  \n",
       "2  0.008301  0.002988  0.006352  \n",
       "3  0.005112  0.004153  0.003944  \n",
       "4  0.007089  0.008629  0.008507  "
      ]
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "allSignals.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Covariance"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The classic approach to PCA is to perform the eigendecomposition on the covariance matrix $\\Sigma$, which is a $n \\times n$ matrix where each element represents the covariance between two features. The covariance between two features is calculated as follows:\n",
    "\n",
    "$sigma = \\frac{1}{K}\\sum_{k=1}^{K}\\frac{\\left(x^{(k)}-\\bar{x}\\right)}{\\sigma}\\frac{\\left(  x^{(k)}-\\bar{x}\\right)^{T}}{\\sigma}$\n",
    "\n",
    "This is standardizing the data\n",
    "\n",
    "pg. 567 of (pattern recognition and machine learning by Bishop\n",
    "\n",
    "Some people use K-1 instead of K for [bessels correction](https://en.wikipedia.org/wiki/Bessel%27s_correction)\n",
    "\n",
    "where $\\mathbf{\\bar{x}}$ is the mean vector \n",
    "$\\mathbf{\\bar{x}} = \\frac{1}{K}\\sum\\limits_{k=1}^K x^{(k)}.$  \n",
    "The mean vector is a $n$-dimensional vector where each value in this vector represents the sample mean of a feature column in the dataset.\n",
    "\n",
    "where $\\sigma = \\sqrt{\\frac{1}{K}\\sum\\limits_{k=1}^K \\left(x^{(k)}-\\bar{x}\\right)^{2}}$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "metadata": {},
   "outputs": [],
   "source": [
    "zeroMean = (allSignals.values - np.mean(allSignals.values, axis = 0)) / np.std(allSignals.values, axis = 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "zeroMean = pd.DataFrame(zeroMean)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "cov_mat = (zeroMean).T.dot((zeroMean)) / (zeroMean.shape[0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "      <th>4</th>\n",
       "      <th>5</th>\n",
       "      <th>6</th>\n",
       "      <th>7</th>\n",
       "      <th>8</th>\n",
       "      <th>9</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.999949</td>\n",
       "      <td>0.020503</td>\n",
       "      <td>-0.005259</td>\n",
       "      <td>-0.499842</td>\n",
       "      <td>-0.499705</td>\n",
       "      <td>0.021266</td>\n",
       "      <td>-0.033131</td>\n",
       "      <td>-0.500137</td>\n",
       "      <td>-0.500114</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.999949</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.020491</td>\n",
       "      <td>-0.005321</td>\n",
       "      <td>-0.499781</td>\n",
       "      <td>-0.499643</td>\n",
       "      <td>0.021383</td>\n",
       "      <td>-0.032668</td>\n",
       "      <td>-0.500199</td>\n",
       "      <td>-0.500177</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.020503</td>\n",
       "      <td>0.020491</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.003529</td>\n",
       "      <td>-0.006914</td>\n",
       "      <td>-0.007091</td>\n",
       "      <td>0.003828</td>\n",
       "      <td>0.028565</td>\n",
       "      <td>-0.013577</td>\n",
       "      <td>-0.013762</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>-0.005259</td>\n",
       "      <td>-0.005321</td>\n",
       "      <td>-0.003529</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.020814</td>\n",
       "      <td>0.021028</td>\n",
       "      <td>0.014538</td>\n",
       "      <td>-0.007491</td>\n",
       "      <td>-0.015633</td>\n",
       "      <td>-0.015366</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>-0.499842</td>\n",
       "      <td>-0.499781</td>\n",
       "      <td>-0.006914</td>\n",
       "      <td>0.020814</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.999949</td>\n",
       "      <td>-0.002468</td>\n",
       "      <td>0.023519</td>\n",
       "      <td>-0.499947</td>\n",
       "      <td>-0.499967</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>-0.499705</td>\n",
       "      <td>-0.499643</td>\n",
       "      <td>-0.007091</td>\n",
       "      <td>0.021028</td>\n",
       "      <td>0.999949</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.002112</td>\n",
       "      <td>0.023456</td>\n",
       "      <td>-0.500082</td>\n",
       "      <td>-0.500105</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>0.021266</td>\n",
       "      <td>0.021383</td>\n",
       "      <td>0.003828</td>\n",
       "      <td>0.014538</td>\n",
       "      <td>-0.002468</td>\n",
       "      <td>-0.002112</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.028703</td>\n",
       "      <td>-0.019078</td>\n",
       "      <td>-0.019046</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>-0.033131</td>\n",
       "      <td>-0.032668</td>\n",
       "      <td>0.028565</td>\n",
       "      <td>-0.007491</td>\n",
       "      <td>0.023519</td>\n",
       "      <td>0.023456</td>\n",
       "      <td>-0.028703</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.009463</td>\n",
       "      <td>0.009645</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>-0.500137</td>\n",
       "      <td>-0.500199</td>\n",
       "      <td>-0.013577</td>\n",
       "      <td>-0.015633</td>\n",
       "      <td>-0.499947</td>\n",
       "      <td>-0.500082</td>\n",
       "      <td>-0.019078</td>\n",
       "      <td>0.009463</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.999950</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>-0.500114</td>\n",
       "      <td>-0.500177</td>\n",
       "      <td>-0.013762</td>\n",
       "      <td>-0.015366</td>\n",
       "      <td>-0.499967</td>\n",
       "      <td>-0.500105</td>\n",
       "      <td>-0.019046</td>\n",
       "      <td>0.009645</td>\n",
       "      <td>0.999950</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          0         1         2         3         4         5         6  \\\n",
       "0  1.000000  0.999949  0.020503 -0.005259 -0.499842 -0.499705  0.021266   \n",
       "1  0.999949  1.000000  0.020491 -0.005321 -0.499781 -0.499643  0.021383   \n",
       "2  0.020503  0.020491  1.000000 -0.003529 -0.006914 -0.007091  0.003828   \n",
       "3 -0.005259 -0.005321 -0.003529  1.000000  0.020814  0.021028  0.014538   \n",
       "4 -0.499842 -0.499781 -0.006914  0.020814  1.000000  0.999949 -0.002468   \n",
       "5 -0.499705 -0.499643 -0.007091  0.021028  0.999949  1.000000 -0.002112   \n",
       "6  0.021266  0.021383  0.003828  0.014538 -0.002468 -0.002112  1.000000   \n",
       "7 -0.033131 -0.032668  0.028565 -0.007491  0.023519  0.023456 -0.028703   \n",
       "8 -0.500137 -0.500199 -0.013577 -0.015633 -0.499947 -0.500082 -0.019078   \n",
       "9 -0.500114 -0.500177 -0.013762 -0.015366 -0.499967 -0.500105 -0.019046   \n",
       "\n",
       "          7         8         9  \n",
       "0 -0.033131 -0.500137 -0.500114  \n",
       "1 -0.032668 -0.500199 -0.500177  \n",
       "2  0.028565 -0.013577 -0.013762  \n",
       "3 -0.007491 -0.015633 -0.015366  \n",
       "4  0.023519 -0.499947 -0.499967  \n",
       "5  0.023456 -0.500082 -0.500105  \n",
       "6 -0.028703 -0.019078 -0.019046  \n",
       "7  1.000000  0.009463  0.009645  \n",
       "8  0.009463  1.000000  0.999950  \n",
       "9  0.009645  0.999950  1.000000  "
      ]
     },
     "execution_count": 83,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cov_mat"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Singular Value Decomposition"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.linalg.svd.html"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "u = Unitary matrices <br>\n",
    "s = singular values for every matrix, sorted in descending order <br>\n",
    "v = unitary matrices (ie U*U = UU* = I)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# N^3 maybe to solve. check...\n",
    "\n",
    "u, s, v = np.linalg.svd(cov_mat, full_matrices=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(10, 10)\n",
      "(10, 10)\n",
      "(10, 10)\n"
     ]
    }
   ],
   "source": [
    "print(u.shape)\n",
    "print(np.diag(s).shape)\n",
    "print(v.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 155,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([-0.56747927, -0.56748362, -0.01773005,  0.00104016,  0.19359666,\n",
       "        0.1935088 , -0.02005341,  0.02678049,  0.37388237,  0.37387364])"
      ]
     },
     "execution_count": 155,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Principal Component 1, is the first eigenvector. \n",
    "v[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 156,
   "metadata": {},
   "outputs": [],
   "source": [
    "#plt.plot(range(0, 10), -(u[0] * s[0]) + np.mean(allSignals.values, axis = 0))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 157,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x1a1aa716d0>]"
      ]
     },
     "execution_count": 157,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAA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uy8COsnQx+5skBxPvhaYC0wHys3sfcFWNTEo3EfJzApJBPuP3P2nQdcToEuBZWa2HVgBvMnMfhhs\nSYFqBprdffCT3MMkwn6iejOwzd3b3L0X+ClwScA1BW2vmcUAkl9bM/EiCvdRMDMjMaa60d3/Neh6\nguTun3H3me4+h8SFskfdfcKembl7C7DLzBYmd10FbAiwpKDtBC4ys7Lkz81VTOALzEkrgZuS398E\n/CITL1KQiSedAC4F3g+8YGbPJfd91t1XBViThMffAj8ysyJgK/ChgOsJjLs/bWYPA8+QmGX2LBPo\nblUz+zFwBVBlZs3APwJfBh4ys4+Q+OX3roy8tu5QFRHJPRqWERHJQQp3EZEcpHAXEclBCncRkRyk\ncBcRyUEKdxGRHKRwFxHJQQp3EZEc9P8BoDieuIKOOaMAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1a1a61dd50>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Principal Component 1\n",
    "plt.plot(range(1, 11), np.mean(allSignals.values, axis = 0) - v[0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 158,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x1a1ab78710>]"
      ]
     },
     "execution_count": 158,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX8AAAD8CAYAAACfF6SlAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAH+NJREFUeJzt3X98VPWd7/HXJ5NMfpLwK0BIBgFF\nEPkhGNDWtrpWq9au6FZBW1e07dptr3W77dprd71tH267j7buvbveXt1Hua0/Vt0q/mhLLa1t/fFo\nH71VCTCAIJRfyoQACZBJA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OSc+7pzrso5N5W+E3mvOOcCe2TnnNsPxMxsZuKljwJbfCzJb3uA\ni82sKPF781ECfAI8ySpgeeLxcuDnXm8g1+s3FKDvaPevgU1mFk289o/OudU+1iTp40vAU2YWBnYB\nd/hcj2+cc2+Y2XPAOvqukltPwFb7mtlPgMuA8WZWC3wT+C6w0sw+S98O8ibPt6sVviIiwaNpHxGR\nAFL4i4gEkMJfRCSAFP4iIgGk8BcRCSCFv4hIACn8RUQCSOEvIhJA/x9C3dt+CpoEbAAAAABJRU5E\nrkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1a1a26e5d0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Principal Component 2\n",
    "plt.plot(range(1, 11), np.mean(allSignals.values, axis = 0) - v[1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 159,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x1a1ac88090>]"
      ]
     },
     "execution_count": 159,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAIABJREFUeJzt3XlwnPd93/H3F/e1S4AEQKwAEqAo\nmljIlkQSVnzEhyKJlpxUcmWnkTJpnTSNkmkUO00mrdxklIw6nckknRzTajpWXCdpG1tVJLmmUyaA\nLcuxo9gOD13GQYmkeIAkDpIgiIO4v/1jFyAIgcIS2N1nj89rBkPssz/ufrlDfvDj7/k938fcHRER\nyS0FQRcgIiLJp3AXEclBCncRkRykcBcRyUEKdxGRHKRwFxHJQQp3EZEcpHAXEclBCYW7md1nZkfM\n7KiZPb7C839s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pk1AT8JfCnoWoJmZmHgo8D/AHD3aXe/FGxVgSsCys2sCKgAzgZcT9q4+3eBi8sOPwj8Zfz7\nvwQ+lYr3Vrivk5m1ALuAHwZbSaD+BPj3wHzQhWSAm4Eh4M/jy1RfMrO8vTO2u58B/gtwCjgHjLh7\nZ7BVBW6zu5+D2EQRqE/FmyhHULCFAAABXElEQVTc18HMqoDngV9398tB1xMEM/spYNDdDwVdS4Yo\nAnYD/93ddwHjpOi/3dkgvp78ILANuAmoNLOfC7aq/KBwXyMzKyYW7H/l7i8EXU+APgw8YGYngGeA\nnzCz/x1sSYHqA/rcfeF/cs8RC/t8dQ/wtrsPufsM8ALwoYBrCtqAmUUA4r8OpuJNFO5rYGZGbE21\nx93/KOh6guTuX3D3JndvIXai7NvunrczM3fvB06b2c74obuB7gBLCtop4ANmVhH/d3M3eXyCOW4f\n8Nn4958Fvp6KNylKxYvmgQ8D/xJ4w8xejR/7j+6+P8CaJHP8GvBXZlYCHAd+IeB6AuPuPzSz54DD\nxHaZvUIeXa1qZl8FPg7Umlkf8LvA7wPPmtkvEvvh99MpeW9doSoiknu0LCMikoMU7iIiOUjhLiKS\ngxTuIiI5SOEuIpKDFO4iIjlI4S4ikoMU7iIiOej/A0fLW/gLJ3HxAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1a1aa89d50>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# First 2 Principal Components\n",
    "plt.plot(range(1, 11), ((np.mean(allSignals.values, axis = 0) - v[0]) + np.mean(allSignals.values, axis = 0) - v[1])/2.0  )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 181,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Cumulative explained variance\n",
    "# remember s is eigenvalues\n",
    "tot = sum(s)\n",
    "cumulative_explained_variance = np.cumsum(s)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 182,
   "metadata": {},
   "outputs": [],
   "source": [
    "cumulative_explained_variance = (np.cumsum(s)/ tot) * 100"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 188,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAmcAAAFNCAYAAABFbcjcAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAIABJREFUeJzs3Xd4HOXVxuHfkdx7l3vvBVOE6SDT\nDJjQAgEChOLgFEJCQui9JUAggRA+iIGACQFDDKaDDcaihBZMce+99yJXlfP9MaOwCJVVWc2u9NzX\npUu7s7M7z847O3t23inm7oiIiIhIckiLOoCIiIiIfEvFmYiIiEgSUXEmIiIikkRUnImIiIgkERVn\nIiIiIklExZmIiIhIElFxJt9hZrea2TOVeP5MM8uqwkgJZWZLzOzYOMfNMbOeCchwkZl9VNWvW8r0\nzjOzSdU1PSmZmb1lZhdGMN07zWyDma2Jc/xKrReiVN2fr2Km/wszWxuuP1pHlUNSi4qzJGFmPzaz\nL8IP8OpwpX141LlKY2ZPmdmdscPcfZC7Z1fxdLqbmYfzJvbv7KqcTlncvYm7L6qu6ZlZAzPbYmZH\nF/PYX8xsfEVe193/5e7HVz5haguXqR0xy9OWBE/vewWOu5/o7mMTOd1icnQBrgQGunv7Yh7PMrMV\nCZz+U+G8HxYzrLeZ1biTbppZXeDPwPHh+mNjMePUC5eN+eHyuMTM/mFm3as7bxQSvbylKhVnScDM\nfgc8APwByAC6Av8HnBplriTUIlzBFf49H3WgRHL33cDzwE9ih5tZOnAuUO4vdTOrUzXpaoyhMctT\ni6jDVJNuwEZ3Xxdhhk3AnWWOlWQq8PnJABoAM0sZZzxwCvBjoDkwFJgKHFORjFJDuLv+Ivwj+DDm\nAGeVMs5TwJ0x97OAFTH3lwBXAdOAHcATBCuFt4DtwLtAy+KeG/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yw\niT7UpZ/heK/xPgGwvV7SOn+19t16Nvxf6h7b3fr8st+Nxhdwre1bN0hOGqD7uduwc/szSVNoFuI+\nG7gYOLZHLhHRMpk5i4hWsL0GeFvSKQCStu/xy88T6t6wccApwDPAeOA/VZgdQjMztikLgV9IOqDG\n2qXiT9JcMqUKvg8qry1xVsf7wtp+lqZIovp/ejN9PATMkrRT5bK3pD020+Z/wM61/07AeNvzgd/Q\nXBqNiDEiM2cR0SbnA7dKuhpYR3Mv2PqN9nma5tLgBGCu7cWSBoGLJC0HXqW5tNmT7dX1o4F7JW0D\nvA+cAFwJ/KX6WQtMH8ExbC/pOZovv+dUbDbwZ0mXAauBmZvJ72FJhwILaxby/8B5NDNlvdwO3CJp\niObev3mSdqCZhbt0BMcREX2ir2bmIyLaTdIMYLLti/udSzeSVtHk90G/c4mIsSuXNSMiIiJaJDNn\nERERES2SmbOIiIiIFklxFhEREdEiKc4iIiIiWiTFWURERESLpDiLiIiIaJEUZxEREREt8gVunIpv\nMp7ywwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1a1c0ef410>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# PLOT OUT THE EXPLAINED VARIANCES SUPERIMPOSED \n",
    "plt.figure(figsize=(10, 5))\n",
    "plt.plot(range(1, 11), cumulative_explained_variance, label='cumulative explained variance')\n",
    "plt.title('Cumulative Explained Variance as a Function of the Number of Components')\n",
    "plt.ylabel('Cumulative Explained variance')\n",
    "plt.xlabel('Principal components')\n",
    "#plt.axhline(y = 95, color='k', linestyle='--', label = '95% Explained Variance')\n",
    "#plt.axhline(y = 90, color='c', linestyle='--', label = '90% Explained Variance')\n",
    "#plt.axhline(y = 85, color='r', linestyle='--', label = '85% Explained Variance')\n",
    "plt.grid()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 138,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x1a19995150>]"
      ]
     },
     "execution_count": 138,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX8AAAD8CAYAAACfF6SlAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAIABJREFUeJzt3Xl0W+d55/HvA4DgBnADSFDWRnEB\nbXmJZdOyRU56cmq7x2knsdNp0zRd3I5TT5pkuqZtupx0TjpLpplpM6dN23jSpnadNk3ctHY7nqSJ\n06YdUrJEW7ZJSZFIULIkUBIJUAT3BcA7fxCgKIkSSWG5AO7zOcdHAHiJ+4YRf7p43vc+rxhjUEop\nZS8OqweglFIq/zT8lVLKhjT8lVLKhjT8lVLKhjT8lVLKhjT8lVLKhjT8lVLKhjT8lVLKhjT8lVLK\nhlxWD+BG/H6/aWlpsXoYSilVVF577bWIMaZxo+MKNvxbWlro7++3ehhKKVVUROTtzRynZR+llLIh\nDX+llLIhDX+llLIhDX+llLIhDX+llLIhDX+llLIhDX+llLIhDX+lbGpuKc5XjpxjYTlh9VCUBQr2\nJi+lVO6MTs7zM8/1c2x0CgTe37XT6iGpPNPwV8pmXj97maefe42F5QRup4NTF6etHpKygJZ9lLKR\nr71+ng98/hBVbidf+0g3nc1eTl7S8LcjvfJXygYSScNnvnGSP/lOiIdaG/ijH7ufhmo3HQEPvcMR\nq4enLKBX/kqVuJnFOP/hL/r5k++E+OCDu/iLpx6kodoNQGfAy6WpRWJzyxaPUuWbXvkrVcLOTczx\noWf7GR6f4VOP38lPPLQbEVn9erDZC8CpsWkeaGmwapjKAhr+SpWoV0eifPj510gkDc/+9H7+TYf/\numM6Ayvhf/Kihr/daPgrVYK+fPgsv/V3g+zyVfGFn+yitdGz7nHbaivwlrs4pZO+tqPhr1Q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+m/o4csHpMVhKR\nX0z9ngyKyF+JSIXVY8onEfkzERkTkcE1rzWIyDdFZCj1Z9Z3utHwz4048MvGmDuAh4CPishei8dk\ntZ8HTlg9iALxv4CvG2NuB96BjX8uIrId+DmgyxhzF+AEPmDtqPLuz4HHrnntE8ArxpgO4JXU86zS\n8M8BY8wFY8zrqcfTrPxyb7d2VNYRkR3ADwBfsHosVhORGuB7gD8FMMYsGWMmrR2V5VxApYi4gCpg\n1OLx5JUx5l+AiWtefhx4NvX4WeCJbJ9Xwz/HRKQF2Ae8au1ILPVZ4FeBpNUDKQCtwDjwxVQZ7Asi\nUm31oKxijAkD/wM4C1wAYsaYf7R2VAUhYIy5ACsXk0BTtk+g4Z9DIuIB/gb4BWPMlNXjsYKI/Ftg\nzBjzmtVjKRAu4D7gj40x+4BZcvCRvlikatmPA3uA24BqEflxa0dlDxr+OSIiZawE/5eMMV+zejwW\n6gHeKyJngC8D3ysiz1s7JEudB84bY9KfBF9g5R8Du3oEOG2MGTfGLANfA7otHlMhuCQi2wBSf45l\n+wQa/jkgIsJKTfeEMeb3rB6PlYwxv26M2WGMaWFlIu/bxhjbXtkZYy4C50SkM/XSw8BxC4dktbPA\nQyJSlfq9eRgbT4Cv8RLwZOrxk8CL2T6BK9tvqICVq92fAAZE5I3Ua79hjHnZwjGpwvEfgS+JiBsY\nAX7a4vFYxhjzqoi8ALzOyiq5o9jsbl8R+SvgXYBfRM4Dvw18GviKiDzFyj+QP5z18+odvkopZT9a\n9lFKKRvS8FdKKRvS8FdKKRvS8FdKKRvS8FdKKRvS8FdKKRvS8FdKKRvS8FdKKRv6/9oE1XLQ7deh\nAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1a19f7ed50>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Look at Principal Component 3\n",
    "plt.plot(range(1, 11), np.mean(allSignals.values, axis = 0) - v[2])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Reconstruct Original Signal"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "np.mean(allSignals.values, axis = 0) +  pd.DataFrame(data = (u * s)) "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Use PCA"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 121,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "zeroMean = allSignals.values - np.mean(allSignals.values, axis = 0)\n",
    "#zeroMean = (allSignals.values - np.mean(allSignals.values, axis = 0)) / np.std(allSignals.values, axis = 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 122,
   "metadata": {},
   "outputs": [],
   "source": [
    "zeroMean = pd.DataFrame(zeroMean)\n",
    "originalNow = pd.DataFrame(allSignals.values)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 123,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0   -3.773833e-16\n",
       "1    2.361629e-16\n",
       "2   -2.672920e-19\n",
       "3    3.356690e-19\n",
       "4   -9.279614e-17\n",
       "5   -6.422640e-17\n",
       "6    3.027092e-19\n",
       "7    3.877107e-19\n",
       "8   -2.353673e-16\n",
       "9   -2.007283e-16\n",
       "dtype: float64"
      ]
     },
     "execution_count": 123,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "zeroMean.mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 124,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Make an instance of the Model\n",
    "pca = PCA(svd_solver = 'full')\n",
    "\n",
    "zeroMean_eig = pca.fit_transform(zeroMean)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 125,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10"
      ]
     },
     "execution_count": 125,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(pca.components_)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 126,
   "metadata": {},
   "outputs": [],
   "source": [
    "#np.mean(df.values, axis = 0) + (u * s)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 127,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 0.33667042,  0.33666095,  0.00500582,  0.00491774,  0.3365535 ,\n",
       "        0.33676409,  0.00497822,  0.0050054 ,  0.33674824,  0.33673292])"
      ]
     },
     "execution_count": 127,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.mean(allSignals.values, axis = 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 128,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 0.33667042,  0.33666095,  0.00500582,  0.00491774,  0.3365535 ,\n",
       "        0.33676409,  0.00497822,  0.0050054 ,  0.33674824,  0.33673292])"
      ]
     },
     "execution_count": 128,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.mean(allSignals.values, axis = 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 129,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(10,)"
      ]
     },
     "execution_count": 129,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pca.components_[0].shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 130,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([  1.10047045e-01,   1.10121241e-01,   2.74863643e-05,\n",
       "         6.82831430e-05,   4.35832870e-01,   4.35916582e-01,\n",
       "         4.93240774e-05,   5.71704808e-06,  -5.45842009e-01,\n",
       "        -5.45752597e-01])"
      ]
     },
     "execution_count": 130,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "-pca.components_[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 131,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 0.44671747,  0.44678219,  0.00503331,  0.00498602,  0.77238637,\n",
       "        0.77268067,  0.00502754,  0.00501112, -0.20909377, -0.20901968])"
      ]
     },
     "execution_count": 131,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "-pca.components_[0] + np.mean(allSignals.values, axis = 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 132,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x1a19c8ab10>]"
      ]
     },
     "execution_count": 132,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX8AAAD8CAYAAACfF6SlAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAIABJREFUeJzt3Xt01Od95/H3d0Y3dB0B4qaZAWyD\nMcbAIMVOmjRNG29jx41JG3Dtjdukm9ZJt27TJm3X6XazOUm3lzTbW+r6JCdpm3WTuPhS202dOo2b\npE3aJBaMAAPGYGxGQlwEaIQkdNezf0gDsiyQYEZ6Zn7zeZ3jg2b0ML+v50gfnnluP3POISIixSXk\nuwAREZl/Cn8RkSKk8BcRKUIKfxGRIqTwFxEpQgp/EZEipPAXESlCCn8RkSKk8BcRKUIlvgu4lMWL\nF7tVq1b5LkNEpKDs3LnztHOuYaZ2OQl/M7sN+HMgDHzBOfeHU74fB74ERCbaPOCce+Zyr7lq1Spa\nWlpyUZ6ISNEws6OzaZf1sI+ZhYEHgduB9cA9ZrZ+SrPfBXY45xLA3cBfZXtdERG5erkY878ZOOyc\nO+KcGwIeAbZOaeOA2omv64COHFxXRESuUi6GfRqBtkmP24FbprT5BPANM/tVoAq4NQf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ee+x3n3DMea5L88avAlyc6SkeAX/BcjzfOuR+Y2WPA\nLsZXySUJ+G5f7fAVESlCQRv2ERGRWVD4i4gUIYW/iEgRUviLiBQhhb+ISBFS+IuIFCGFv4hIEVL4\ni4gUof8PDoNazPCJ26UAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1a12c34a90>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 1st Principal Component\n",
    "plt.plot(range(0, 10), -pca.components_[0] + np.mean(allSignals.values, axis = 0))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 133,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x1a19e56190>]"
      ]
     },
     "execution_count": 133,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX8AAAD8CAYAAACfF6SlAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAIABJREFUeJzt3Xt0nHd5J/Dvo9H9Prr5osvIjq+y\nE9vSYBLCJSTBJAUSTgtpchaatrA53W3acilsoAW2KeeUUkrZLem2OcAuBbaQhLAYNhCJJOUAIVk0\nsp1YYzu+aXSxNbqN7teZefYPSbYiS7IuM/N7L9/POTrRzLzS+3gy851Xz/u+zyuqCiIicpc00wUQ\nEVHqMfyJiFyI4U9E5EIMfyIiF2L4ExG5EMOfiMiFGP5ERC7E8CciciGGPxGRC6WbLmA5ZWVlWltb\na7oMIiJbCQQCfapafr3lLBv+tbW1aG5uNl0GEZGtiEhoNcux7UNE5EIMfyIiF2L4ExG5EMOfiMiF\nGP5ERC7E8CciciGGPxGRC1n2OH+iZHj5Qj+aQ5ErtxdfxnTxVU11xcdW/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AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1a19dd2750>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 1st Principal Component\n",
    "plt.plot(range(0, 10), -pca.components_[1] + np.mean(allSignals.values, axis = 0))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 134,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x1a1a00df50>]"
      ]
     },
     "execution_count": 134,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX8AAAD8CAYAAACfF6SlAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAIABJREFUeJzt3XlYXOeV5/HvW1XsVSxVQCEkxCJR\nyJIlWQILbMmyncRppx3LThyvibM4idJxnE7PdKcnk+knk06mezLd09PpGTtOnLgTZ5W8xZYTZ2kn\nEV6FQKsl2YAEkkBIUIDY16p65w8ojDCIpZZby/k8jx+zXNV9jeGny7nnnldprRFCCBFfTEYvQAgh\nRPhJ+AshRByS8BdCiDgk4S+EEHFIwl8IIeKQhL8QQsQhCX8hhIhDEv5CCBGHJPyFECIOWYxewFyy\ns7N1UVGR0csQQoiocuDAgU6tdc58x0Vs+BcVFVFXV2f0MoQQIqoopc4s5Dgp+wghRByS8BdCiDgk\n4S+EEHFIwl8IIeKQhL8QQsQhCX8hhIhDEv5CCBGHghL+SqmblVL1SqmTSqmvzHHMXUqpE0qp40qp\nnwfjvLPpHRrn315q5GhrT6hOIYQQUS/gh7yUUmbgEeAmoBWoVUrt0VqfmHZMKfBfga1a64tKqdxA\nzzsXkwn+9aUGLGbFhhWZoTqNEEJEtWBc+W8BTmqtm7TWY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Bi/LSFuB+4E3lVKHJz/2Va31iwauSUSOLwI/\nm7xQagI+ZfB6DKO1rlFKPQ0cZKJL7hAx/rSvPOErhBBxKNbKPkIIIRZAwl8IIeKQhL8QQsQhCX8h\nhIhDEv5CCBGHJPyFECIOSfgLIUQckvAXQog49P8BvuvB0TwxKv4AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1a19e630d0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 3rd, Principal Component\n",
    "# Garbage\n",
    "plt.plot(range(0, 10), pca.components_[2])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 135,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x1a1a0a48d0>]"
      ]
     },
     "execution_count": 135,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAIABJREFUeJzt3Xt4XGW9L/Dvbya3JjO9ZjKBtjQt\nzQxU5BoQLKJsxQOorW4RC4LgEYo+rXfPEdjK8WFvn3O2bAUv9QKoW3FjuahYtVo36t5ucINNuQil\nziSU0KZtJul95Z7M/M4fyUqnYZKsJjPzrrXm+3mePk9mZnX6Y8h85513/db7iqqCiIj8JWC6ACIi\nyj+GOxGRDzHciYh8iOFORORDDHciIh9iuBMR+RDDnYjIhxjuREQ+xHAnIvKhMlP/cG1trTY0NJj6\n54mIPGnbtm37VTUy1XHGwr2hoQHNzc2m/nkiIk8SkVedHMdpGSIiH2K4ExH5EMOdiMiHGO5ERD7E\ncCci8iGGOxGRDzHciYh8yFifO1G+ZTKKR7btxt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awB+q6qnATgLJfq6iMhCAB8H0KSqZ2BkAUTfL27oqXBH1pZ/qjoIwN7yr+So6j5V\nfWb0Zwsjb9yFZqsyS0QWAXgHgPtN12KaiMwGcAlGVmyFqg6q6mGzVRlVBmDW6H4T1XjtnhS+47Vw\nz7XlX0kHGgCISAOAcwA8bbYS4+4B8L8BZEwX4gLLAHQB+MHoNNX9IlJjuigTVHUPgH8BsAvAPgBH\nVPV3ZqsqPK+Fu6Pt/EqJiIQA/BTAJ1X1qOl6TBGRdwLoVNVtpmtxiTIA5wL4tqqeA6AHQEmeoxKR\neRj5hr8UwMkAakTkOrNVFZ7Xwt3Jln8lQ0TKMRLs/6aqPzNdj2ErAawSkTaMTNf9nYj82GxJRrUD\naFdV+9vcoxgJ+1L0NgCvqGqXqg4B+BmANxquqeC8Fu5OtvwrCSIiGJlP3aGqXzVdj2mqepuqLlLV\nBoz8XvxBVX0/OpuIqnYA2C0i8dG73grgJYMlmbQLwIUiUj36vnkrSuDksqOdmNxioi3/DJdlykoA\n1wN4QUSeG73v9tFds4gA4GMA/m10ILQTwIcM12OEqj4tIo8CeAYjXWbPogSuVOUVqkREPuS1aRki\nInKA4U5E5EMMdyIiH2K4ExH5EMOdiMiHGO5ERD7EcCci8iGGOxGRD/1/xHOUezv662QAAAAASUVO\nRK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1a19dd2b10>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# First Two PCA. \n",
    "plt.plot(range(0, 10),   np.mean(allSignals.values, axis = 0) - (pca.components_[0] + pca.components_[1]) /2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Explained Variance"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 407,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "tot = sum(pca.explained_variance_)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 408,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "var_exp = [(i/tot)*100 for i in sorted(pca.explained_variance_, reverse=True)] "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 409,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[50.005288650721461,\n",
       " 49.988785689398554,\n",
       " 0.00088030964365937517,\n",
       " 0.00086460573189138111,\n",
       " 0.00085123312730677348,\n",
       " 0.00082158963188483066,\n",
       " 0.00064317776160355646,\n",
       " 0.00063943081326163791,\n",
       " 0.00061692024431044793,\n",
       " 0.00060839292607892852]"
      ]
     },
     "execution_count": 409,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "var_exp"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 410,
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (<ipython-input-410-9f87d41cd3b2>, line 2)",
     "output_type": "error",
     "traceback": [
      "\u001b[0;36m  File \u001b[0;32m\"<ipython-input-410-9f87d41cd3b2>\"\u001b[0;36m, line \u001b[0;32m2\u001b[0m\n\u001b[0;31m    plt.\u001b[0m\n\u001b[0m        ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n"
     ]
    }
   ],
   "source": [
    "plt.plot(range(1,11), var_exp)\n",
    "plt."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 142,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Cumulative explained variance\n",
    "cum_var_exp = np.cumsum(var_exp)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 144,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([  49.77087541,   99.32346362,   99.43447399,   99.53860057,\n",
       "         99.63798586,   99.73303035,   99.80750921,   99.87946081,\n",
       "         99.94433094,  100.        ])"
      ]
     },
     "execution_count": 144,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cum_var_exp"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 216,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\"\\n\\n# PLOT OUT THE EXPLAINED VARIANCES SUPERIMPOSED \\nplt.figure(figsize=(10, 5))\\nplt.step(range(0, 0), cum_var_exp, where='mid',label='cumulative explained variance')\\nplt.title('Cumulative Explained Variance as a Function of the Number of Components')\\nplt.ylabel('Cumulative Explained variance')\\nplt.xlabel('Principal components')\\n#plt.axhline(y = 95, color='k', linestyle='--', label = '95% Explained Variance')\\n#plt.axhline(y = 90, color='c', linestyle='--', label = '90% Explained Variance')\\nplt.axhline(y = 85, color='r', linestyle='--', label = '85% Explained Variance')\\nplt.legend(loc='best')\\nplt.show()\\n\\n\""
      ]
     },
     "execution_count": 216,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\"\"\"\n",
    "\n",
    "# PLOT OUT THE EXPLAINED VARIANCES SUPERIMPOSED \n",
    "plt.figure(figsize=(10, 5))\n",
    "plt.step(range(0, 0), cum_var_exp, where='mid',label='cumulative explained variance')\n",
    "plt.title('Cumulative Explained Variance as a Function of the Number of Components')\n",
    "plt.ylabel('Cumulative Explained variance')\n",
    "plt.xlabel('Principal components')\n",
    "#plt.axhline(y = 95, color='k', linestyle='--', label = '95% Explained Variance')\n",
    "#plt.axhline(y = 90, color='c', linestyle='--', label = '90% Explained Variance')\n",
    "plt.axhline(y = 85, color='r', linestyle='--', label = '85% Explained Variance')\n",
    "plt.legend(loc='best')\n",
    "plt.show()\n",
    "\n",
    "\"\"\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 136,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 0.49770875,  0.49552588,  0.0011101 ,  0.00104127,  0.00099385,\n",
       "        0.00095044,  0.00074479,  0.00071952,  0.0006487 ,  0.00055669])"
      ]
     },
     "execution_count": 136,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pca.cexplained_variance_ratio_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 292,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-1, -1],\n",
       "       [-2, -1],\n",
       "       [-3, -2],\n",
       "       [ 1,  1],\n",
       "       [ 2,  1],\n",
       "       [ 3,  2]])"
      ]
     },
     "execution_count": 292,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# example data from sklearn: http://scikit-learn.org/stable/modules/generated/sklearn.decomposition.PCA.html\n",
    "X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]])\n",
    "X"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 293,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.038008155791571234"
      ]
     },
     "execution_count": 293,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.random.uniform(0,.1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### Create the PCA fit using sklearn function\n",
    "\n",
    "We will see what is going on behind the scenes below.  For the purposes of this example, we keep all components so that we can fully reconstruct the original parameter matrix, $X$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "PCA(copy=True, iterated_power='auto', n_components=2, random_state=None,\n",
       "  svd_solver='auto', tol=0.0, whiten=False)"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pca = PCA(n_components=2)\n",
    "pca.fit(X)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### Transform the data into new space using sklearn built in function\n",
    "\n",
    "Formally, we are projected the original parameters onto the new space defined by directions of maximum variance (where the directions are orthogonal to eachother)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 1.38340578,  0.2935787 ],\n",
       "       [ 2.22189802, -0.25133484],\n",
       "       [ 3.6053038 ,  0.04224385],\n",
       "       [-1.38340578, -0.2935787 ],\n",
       "       [-2.22189802,  0.25133484],\n",
       "       [-3.6053038 , -0.04224385]])"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# representation of X in transformed space, ie, projection of X onto new basis\n",
    "Z = pca.transform(X)\n",
    "Z"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### The new space is represented by a basis, which happen to be the eigenvectors\n",
    "\n",
    "these are the eigenvectors (directions) for the transformed data in the reduced space"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-0.83849224, -0.54491354],\n",
       "       [ 0.54491354, -0.83849224]])"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pca.components_ "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### In solving the PCA problem, the eigenvectors are constructed to be orthonormal\n",
    "\n",
    "that is, $ \\vec{e}_i \\cdot  \\vec{e}_j = 0$ when $j \\ne i$ and $ \\vec{e}_i \\cdot  \\vec{e}_j = 1$ when $j = i$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.0\n",
      "1.0\n"
     ]
    }
   ],
   "source": [
    "print(np.dot(pca.components_[:,0],pca.components_[:,1]))\n",
    "print(np.dot(pca.components_[:,0],pca.components_[:,0]))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### Singular values\n",
    "\n",
    "We will say more about these below"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 6.30061232,  0.54980396])"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pca.singular_values_"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### Transform from new space back to the original parameter space\n",
    "\n",
    "projection of new basis representation of $X$ back to original basis representation of $X$, which recovers original data (when all components used)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-1., -1.],\n",
       "       [-2., -1.],\n",
       "       [-3., -2.],\n",
       "       [ 1.,  1.],\n",
       "       [ 2.,  1.],\n",
       "       [ 3.,  2.]])"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pca.inverse_transform(Z)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Above, we have shown the full deconstruction and reconstruction of X when using all components.\n",
    "\n",
    "We will now walk through two separate calculations using some linear algebra (which is what sklearn functions are actually doing)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### We will compute the Covariance matrix $C$ and corresponding eigenvectors and eigenvalues"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "C = 1/(X.shape[0])*np.dot(X.T,X)\n",
    "w, v = np.linalg.eig(C) "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### The components output from sklearn is simply the eigenvalues of the covariance matrix"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.83849224, -0.54491354],\n",
       "       [ 0.54491354,  0.83849224]])"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "v"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### The eigenvalues do not show up explicitly in the sklearn object, but are nothing more than the (scaled) square of the singular values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 6.30061232,  0.54980396])"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.sqrt(w*(X.shape[0]))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### you can calculate your eigenvectors with the PCA outputs\n",
    "\n",
    "$ Z = XV$ where $V'$ = pca.components_ array"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 1.38340578,  0.2935787 ],\n",
       "       [ 2.22189802, -0.25133484],\n",
       "       [ 3.6053038 ,  0.04224385],\n",
       "       [-1.38340578, -0.2935787 ],\n",
       "       [-2.22189802,  0.25133484],\n",
       "       [-3.6053038 , -0.04224385]])"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Z1 = np.dot(X,pca.components_.T)\n",
    "Z1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# SVD can be recovered: X = U*sig*V'\n",
    "sig_inv = np.linalg.inv(np.eye(2)*pca.singular_values_)\n",
    "\n",
    "U = np.dot(Z1,sig_inv) \n",
    "U"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# check U orthonormal\n",
    "print(np.dot(U[:,0],U[:,1]))\n",
    "np.linalg.norm(np.dot(U[:,0],U[:,1])) < 10**-10"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### map back to original space"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "Xhat = np.dot(Z1,pca.components_)\n",
    "Xhat"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<h3>Now use Singular Value Decomposition (SVD) to do same thing without using sklearn wrapper</h3>\n",
    "\n",
    "$ X = U\\Sigma V'$ is the common SVD representation, where $U$ and $V$ are unitary, and $\\Sigma$ is diagonal.  Then, we have,\n",
    "\n",
    "$Z := XV = U\\Sigma $ and clearly, to recover $X$, we have $X = ZV' = XVV'$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "u, s, vh = np.linalg.svd(X, full_matrices=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(6, 6)\n",
      "(2, 2)\n",
      "(2, 2)\n"
     ]
    }
   ],
   "source": [
    "print(u.shape)\n",
    "print(np.diag(s).shape)\n",
    "print(vh.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-0.21956688,  0.53396977, -0.48030985,  0.45219595,  0.02811389,\n",
       "         0.48030985],\n",
       "       [-0.35264795, -0.45713538, -0.30371038, -0.31508521,  0.61879559,\n",
       "         0.30371038],\n",
       "       [-0.57221483,  0.07683439,  0.75680405,  0.17257785,  0.0706181 ,\n",
       "         0.24319595],\n",
       "       [ 0.21956688, -0.53396977,  0.03329824,  0.79735166,  0.1693501 ,\n",
       "        -0.03329824],\n",
       "       [ 0.35264795,  0.45713538,  0.20989771,  0.03007049,  0.7600318 ,\n",
       "        -0.20989771],\n",
       "       [ 0.57221483, -0.07683439,  0.24319595, -0.17257785, -0.0706181 ,\n",
       "         0.75680405]])"
      ]
     },
     "execution_count": 58,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "u"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 6.30061232,  0.54980396])"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 6.30061232,  0.        ],\n",
       "       [ 0.        ,  0.54980396],\n",
       "       [ 0.        ,  0.        ],\n",
       "       [ 0.        ,  0.        ],\n",
       "       [ 0.        ,  0.        ],\n",
       "       [ 0.        ,  0.        ]])"
      ]
     },
     "execution_count": 60,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# full representation of singular values\n",
    "S = np.zeros((6, 2))\n",
    "S[:2, :2] = np.diag(s)\n",
    "S"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.83849224,  0.54491354],\n",
       "       [ 0.54491354, -0.83849224]])"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "vh"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### Create basis for transformed space, ie, create $Z$.  Note that this will equal sklearn up to order, to get perfect match, we would order these based on largest singular value"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-1.38340578,  0.2935787 ],\n",
       "       [-2.22189802, -0.25133484],\n",
       "       [-3.6053038 ,  0.04224385],\n",
       "       [ 1.38340578, -0.2935787 ],\n",
       "       [ 2.22189802,  0.25133484],\n",
       "       [ 3.6053038 , -0.04224385]])"
      ]
     },
     "execution_count": 65,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Z2 = np.dot(X,vh.T)\n",
    "Z2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### Map back to original paramter space, ie, recover X"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-1., -1.],\n",
       "       [-2., -1.],\n",
       "       [-3., -2.],\n",
       "       [ 1.,  1.],\n",
       "       [ 2.,  1.],\n",
       "       [ 3.,  2.]])"
      ]
     },
     "execution_count": 68,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Xhat1 = np.dot(Z2,vh)\n",
    "Xhat1"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Concluding Remarks\n",
    "\n",
    "In using PCA Analysis, to reduce dimension, we simply start removing eigenvectors that correspond to 'small' eigenvalues, then proceed with the same calculation.  \n",
    "\n",
    "Or, in terms of [SVD](https://en.wikipedia.org/wiki/Singular-value_decomposition), remove singular values that are 'small' and their corresponding singular vectors.  \n",
    "\n",
    "In either case, you proceed with the calculations above with the reduced matrices / vectors.\n",
    "\n",
    "#### That's it, now you're an expert in the PCA done by sklearn"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Tutorial"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Get Data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "url = \"https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data\"\n",
    "\n",
    "# load dataset into Pandas DataFrame\n",
    "df = pd.read_csv(url, names=['sepal length','sepal width','petal length','petal width','target'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = df.iloc[:, 0:-1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>sepal length</th>\n",
       "      <th>sepal width</th>\n",
       "      <th>petal length</th>\n",
       "      <th>petal width</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>5.1</td>\n",
       "      <td>3.5</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4.9</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4.7</td>\n",
       "      <td>3.2</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.6</td>\n",
       "      <td>3.1</td>\n",
       "      <td>1.5</td>\n",
       "      <td>0.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>3.6</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   sepal length  sepal width  petal length  petal width\n",
       "0           5.1          3.5           1.4          0.2\n",
       "1           4.9          3.0           1.4          0.2\n",
       "2           4.7          3.2           1.3          0.2\n",
       "3           4.6          3.1           1.5          0.2\n",
       "4           5.0          3.6           1.4          0.2"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Covariance"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The classic approach to PCA is to perform the eigendecomposition on the covariance matrix $\\Sigma$, which is a $n \\times n$ matrix where each element represents the covariance between two features. The covariance between two features is calculated as follows:\n",
    "\n",
    "$sigma = \\frac{1}{K}\\sum_{k=1}^{K}\\frac{\\left(x^{(k)}-\\bar{x}\\right)}{\\sigma}\\frac{\\left(  x^{(k)}-\\bar{x}\\right)^{T}}{\\sigma}$\n",
    "\n",
    "This is standardizing the data\n",
    "\n",
    "pg. 567 of (pattern recognition and machine learning by Bishop\n",
    "\n",
    "Some people use K-1 instead of K for [bessels correction](https://en.wikipedia.org/wiki/Bessel%27s_correction)\n",
    "\n",
    "where $\\mathbf{\\bar{x}}$ is the mean vector \n",
    "$\\mathbf{\\bar{x}} = \\frac{1}{K}\\sum\\limits_{k=1}^K x^{(k)}.$  \n",
    "The mean vector is a $n$-dimensional vector where each value in this vector represents the sample mean of a feature column in the dataset.\n",
    "\n",
    "where $\\sigma = \\sqrt{\\frac{1}{K}\\sum\\limits_{k=1}^K \\left(x^{(k)}-\\bar{x}\\right)^{2}}$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "zeroMean = (df.values - np.mean(df.values, axis = 0)) / np.std(df.values, axis = 0)\n",
    "#zeroMean = (df.values - np.mean(df.values, axis = 0))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "zeroMean = pd.DataFrame(zeroMean)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "cov_mat = (zeroMean).T.dot((zeroMean)) / (zeroMean.shape[0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.109369</td>\n",
       "      <td>0.871754</td>\n",
       "      <td>0.817954</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>-0.109369</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.420516</td>\n",
       "      <td>-0.356544</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.871754</td>\n",
       "      <td>-0.420516</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.962757</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.817954</td>\n",
       "      <td>-0.356544</td>\n",
       "      <td>0.962757</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          0         1         2         3\n",
       "0  1.000000 -0.109369  0.871754  0.817954\n",
       "1 -0.109369  1.000000 -0.420516 -0.356544\n",
       "2  0.871754 -0.420516  1.000000  0.962757\n",
       "3  0.817954 -0.356544  0.962757  1.000000"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cov_mat"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Singular Value Decomposition"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.linalg.svd.html"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "u = Unitary matrices <br>\n",
    "s = singular values for every matrix, sorted in descending order <br>\n",
    "v = unitary matrices (ie U*U = UU* = I)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# N^3 maybe to solve. check...\n",
    "\n",
    "u, s, v = np.linalg.svd(cov_mat, full_matrices=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(10, 10)\n",
      "(10, 10)\n",
      "(10, 10)\n"
     ]
    }
   ],
   "source": [
    "print(u.shape)\n",
    "print(np.diag(s).shape)\n",
    "print(v.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 2.91081808,  0.92122093,  0.14735328,  0.02060771])"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-0.52237162,  0.26335492, -0.58125401, -0.56561105],\n",
       "       [-0.37231836, -0.92555649, -0.02109478, -0.06541577],\n",
       "       [ 0.72101681, -0.24203288, -0.14089226, -0.6338014 ],\n",
       "       [ 0.26199559, -0.12413481, -0.80115427,  0.52354627]])"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "v"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 452,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 4.32280457,  2.71101253,  3.86491086,  1.2040658 ],\n",
       "       [ 6.60991158,  2.20135799,  3.72300233,  1.19610853],\n",
       "       [ 4.15140866,  3.03456705,  3.73790573,  1.18215671],\n",
       "       [ 4.19694246,  2.99373762,  3.66527395,  1.20945575]])"
      ]
     },
     "execution_count": 452,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    " np.mean(df.values, axis = 0) + (u * s)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 453,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 5.84333333,  3.054     ,  3.75866667,  1.19866667])"
      ]
     },
     "execution_count": 453,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.mean(df.values, axis = 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 454,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 5.84333333,  3.054     ,  3.75866667,  1.19866667])"
      ]
     },
     "execution_count": 454,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.mean(df.values, axis = 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 215,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 2.91081808,  0.92122093,  0.14735328,  0.02060771])"
      ]
     },
     "execution_count": 215,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python [conda root]",
   "language": "python",
   "name": "conda-root-py"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
